// TaskOrgView.h : interface of the CTaskOrgView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TASKORGVIEW_H__7B74BB17_37A8_11D7_8ECD_A035DECA1E5B__INCLUDED_)
#define AFX_TASKORGVIEW_H__7B74BB17_37A8_11D7_8ECD_A035DECA1E5B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CTaskOrgSet;

class CTaskOrgView : public CDaoRecordView
{
protected: // create from serialization only
	CTaskOrgView();
	DECLARE_DYNCREATE(CTaskOrgView)

public:
	//{{AFX_DATA(CTaskOrgView)
	enum { IDD = IDD_TASKORG_FORM };
	CEdit	m_ctlStatus;
	CComboBox	m_ctlFilterByResp;
	CButton	m_ctlShowDeadlineTasks;
	CEdit	m_ctlWarnPeriod;
	CEdit	m_ctlWarnBefore;
	CEdit	m_ctlDeadline;
	CEdit	m_ctlWaitFor;
	CEdit	m_ctlConcerns;
	CEdit	m_ctlPriority;
	CEdit	m_ctlEndPerson;
	CEdit	m_ctlEndDateTime;
	CEdit	m_ctlDescription;
	CEdit	m_ctlTopic;
	CEdit	m_ctlResponsible;
	CButton	m_ctlCompleted;
	CEdit	m_ctlStartDateTime;
	CEdit	m_ctlStartPerson;
	CEdit	m_ctlParentTaskID;
	CEdit	m_ctlID;
	CButton	m_ctlHideSubTasks;
	CEdit	m_ctlNotes;
	CButton	m_ctlShowAllTasks;
	CButton	m_ctlShowSubTasks;
	CComboBox	m_ctlFilterBy;
	CStatic	m_ctlTaskCount;
	CTaskListCtrl	m_ctlTaskList;
	CButton	m_ctlHideFinishedTasks;
	CEdit	m_ctlFilter;
	CComboBox	m_ctlSortBy;
	CTaskOrgSet* m_pSet;
	//}}AFX_DATA

// Attributes
public:
	CTaskOrgDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTaskOrgView)
	public:
	virtual CDaoRecordset* OnGetRecordset();
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnMove(UINT nIDMoveCommand);
	virtual BOOL DestroyWindow();
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnDraw(CDC* pDC);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	BOOL m_TodayMode;
	void PrintPageHeader(CDC* pDC, CPrintInfo* pInfo, CString& strHeader);
	virtual ~CTaskOrgView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	void AddRecord(BOOL CreateSubTask=FALSE);
	CString m_responsibleFilter;
	void SetRowSelected (int row);
	CTaskOrgDoc* m_pDoc;
	BOOL MyTryCatchRequery(CString s);
	BOOL MyTryCatchUpdate(CString s);
	COLORREF m_TextColor;
	COLORREF m_TextBkColor;
	COLORREF m_BkColor;
	void SetTaskListColor();
	BOOL m_DeadlineMode;
	void CalcWarnDate(CString* deadline,int days,CString* warndate);
	CString m_IDFilter;
	int m_saveFilterBy;
	CString m_saveFilter;
	CString m_saveSubTaskFilter;
	CString m_saveFinishedFilter;
	CString m_saveWaitForFilter;
	CString m_saveTopicFilter;
	void SetFilter();
	CString m_subTaskFilter;
	CString m_waitForFilter;
	CString m_topicFilter;
	BOOL m_oldHideSubTasks;
	int m_NameIndex;
	CString m_Names[10];
	long m_actParentTaskID;
	CString m_allTasksSort;
	CString m_allTasksFilter;
	void Requery();
	BOOL m_SubTask;
	void EditTask(int rowNo, int colNo);
	CString m_normalFilter;
	CString m_currID;
	int m_forceRequery;
	int m_sortField;
	int m_currentControl;
	int m_TaskListRows;
	void MyRequery();
	CString m_finishedFilter;
	CString m_tempFilter;
	long m_lastID;
	void GetDateTime(CString *s);
	BOOL m_bAddMode;
	//{{AFX_MSG(CTaskOrgView)
	afx_msg void OnRecordRefresh();
	afx_msg void OnRecordAdd();
	afx_msg void OnSelendokSortby();
	afx_msg void OnHidefinishedtasks();
	afx_msg void OnEditCopy();
	afx_msg void OnEditPaste();
	afx_msg void OnSetfocusNotes();
	afx_msg void OnKillfocusNotes();
	afx_msg void OnDblclkTasklist(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnClickTasklist(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKeydownTasklist(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnColumnclickTasklist(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKillfocusFilter();
	afx_msg void OnSetfocusFilter();
	afx_msg void OnEditCut();
	afx_msg void OnSelendokFilterby();
	afx_msg void OnEditUndo();
	afx_msg void OnShowSubtasks();
	afx_msg void OnHidesubtasks();
	afx_msg void OnShowdeadlinetasks();
	afx_msg void OnSearch();
	afx_msg void OnGeneratedoc();
	afx_msg void OnUsers();
	afx_msg void OnSelendokFilterbyresp();
	afx_msg void OnRecordEdit();
	afx_msg void OnRecordAddSub();
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnRecordDelete();
	afx_msg void OnRecordNext();
	afx_msg void OnRecordPrev();
	afx_msg void OnRecordLast();
	afx_msg void OnRecordFirst();
	afx_msg void OnBtall();
	afx_msg void OnBtfelf();
	afx_msg void OnBtfind();
	afx_msg void OnBttasks();
	afx_msg void OnBttoday();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	BOOL m_IsPrinting;
};

#ifndef _DEBUG  // debug version in TaskOrgView.cpp
inline CTaskOrgDoc* CTaskOrgView::GetDocument()
   { return (CTaskOrgDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TASKORGVIEW_H__7B74BB17_37A8_11D7_8ECD_A035DECA1E5B__INCLUDED_)
